﻿// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236

using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
using Microsoft.Practices.Prism.Mvvm.Interfaces;
using Microsoft.Practices.Unity;

namespace CityDashboard.Views
{
    public sealed partial class LineChart : UserControl
    {
        public LineChart()
        {
            this.InitializeComponent();
            this.Loaded += MainPage_Loaded;
        }

        public class data
        {
            public string year { get; set; }
            public int Amount { get; set; }
        }


        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            LoadChartContents();
        }

        private void LoadChartContents()
        {
            //Random rand = new Random();

            //// data
            //List<data> datas = new List<data>();
            //datas.Add(new data() { year = "1", Amount = rand.Next(0, 200) });
            //datas.Add(new data() { year = "2", Amount = rand.Next(0, 200) });
            //datas.Add(new data() { year = "3", Amount = rand.Next(0, 200) });
            //datas.Add(new data() { year = "4", Amount = rand.Next(0, 200) });

            //(LineChartUC.Series[0] as LineSeries).ItemsSource = datas;
            /*
             * Custom fix cứng biểu đồ ... truyền tham số minimum và maximum cho nó
             * ((LineSeries)this.LineChart2.Series[0]).DependentRangeAxis = new LinearAxis() { Minimum = 0, Maximum = 100, Orientation = AxisOrientation.Y};
             */
        }

        private void HeaderClick(object sender, RoutedEventArgs e)
        {
            
        }

        private void UIElement_OnTapped(object sender, TappedRoutedEventArgs e)
        {
            
        }

        private void UIElement_XOnTapped(object sender, TappedRoutedEventArgs e)
        {
            
        }

        
    }
}
